package com.xlserver.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xlserver.util.model.SupervisorInfo;
import lombok.Data;

@Data
@TableName("supervisor_info")
public class Supervisor {
    @TableId(value = "sid",type = IdType.AUTO)
    private Integer sid;

    @TableField("sName")
    private String name;

    @TableField("sProfilePhoto")
    private String profilePhoto;

    @TableField("sAssistanceCompleted")
    private Integer assistanceCompleted;

    @TableField("sAssistanceTime")
    private int assistanceTime;

    @TableField("sSchedule")
    private String schedule;

    @TableField("sUsername")
    private String username;

    @TableField("sGender")
    private int gender;

    @TableField("sAge")
    private int age;

    @TableField("sIdNumber")
    private String idNumber;

    @TableField("sPhoneNum")
    private String phoneNum;

    @TableField("sEmail")
    private String email;

    @TableField("sJob")
    private String job;

    @TableField("sTitle")
    private String title;

    @TableField("sCertification")
    private String certification;

    @TableField("sCertificationId")
    private String certificationId;

    @TableField("sRank")
    private int sRank;

    public Supervisor() {
    }

    public Supervisor(Integer sid, String name, String profilePhoto, Integer assistanceCompleted, int assistanceTime, String schedule, String username, int gender, int age, String idNumber, String phoneNum, String email, String job, String title, String certification, String certificationId) {
        this.sid = sid;
        this.name = name;
        this.profilePhoto = profilePhoto;
        this.assistanceCompleted = assistanceCompleted;
        this.assistanceTime = assistanceTime;
        this.schedule = schedule;
        this.username = username;
        this.gender = gender;
        this.age = age;
        this.idNumber = idNumber;
        this.phoneNum = phoneNum;
        this.email = email;
        this.job = job;
        this.title = title;
        this.certification = certification;
        this.certificationId = certificationId;
    }

    public Supervisor(SupervisorInfo supervisorInfo) {
        this.name = supervisorInfo.getName();
        this.schedule = supervisorInfo.getSchedule();
        this.username = supervisorInfo.getUsername();//查重
        this.gender = supervisorInfo.getGender();
        this.age = supervisorInfo.getAge();
        this.idNumber = supervisorInfo.getIdNumber();//查重
        this.phoneNum = supervisorInfo.getPhoneNum();
        this.email = supervisorInfo.getPhoneNum();
        this.job = supervisorInfo.getJob();
        this.title = supervisorInfo.getTitle();
        this.certification = supervisorInfo.getCertification();
        this.certificationId = supervisorInfo.getCertificationId();
    }
}
